public class Test {

        public static void main(String[] args) {
            Thread t = new Thread(()->{
                System.out.println("sleep之前："+Thread.currentThread().isInterrupted());
                try {
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    e.printStackTrace();
                }
            });
            t.start();
            /*System.out.println("Point X: Thread.interrupted()=" + Thread.interrupted());
            Thread.currentThread().interrupt();
            System.out.println("Point Y: Thread.interrupted()=" + Thread.interrupted());
            System.out.println("Point Z: Thread.interrupted()=" + Thread.interrupted());
            System.out.println("Point T: Thread.interrupted()=" + Thread.interrupted());*/
            System.out.println("Point X: Thread.interrupted()=" + Thread.currentThread().isInterrupted());
            Thread.currentThread().interrupt();
            System.out.println("Point Y: Thread.interrupted()=" + Thread.currentThread().isInterrupted());
            System.out.println("Point Z: Thread.interrupted()=" + Thread.currentThread().isInterrupted());
            System.out.println("Point T: Thread.interrupted()=" + Thread.currentThread().isInterrupted());
        }
}
